module D
  def run(*args)
    puts "#{self.name} : D : #{args}"
  end
end

module A
  include D
  
  def run(*args)
    puts "A : #{args}"
  end
end

module B
  include D
  
  def run(*args)
    puts "B : #{args}"
  end
end

class C
  module E
    def e
      puts "e"
    end
  end
  
  include E
  
  class IB
    include B
  end
  
  class IA
    include A
  end
  
  public
  def initialize
    @ib = IB.new
    @ia = IA.new
  end
  
  def c(*args)
    @ib.run(args)
    @ia.run(args)
    e
  end
end

c = C.new
c.c(['a', 'b'])

puts C::IB.new